<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>PintarOS: include/tea.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">PintarOS
   </div>
   <div id="projectbrief">Operating System for Smart Card</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">tea.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="tea_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#ifndef TEA_H</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define TEA_H</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;types.h&quot;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#define iu32    uint32_t</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define iu16    uint16_t</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define iu8     uint8_t</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="tea_8h.html#ac52845e68e2ba28492bfe7713ecd4446">   19</a></span>&#160;<span class="preprocessor">#define TEA_KEY_LEN     16  </span></div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="tea_8h.html#a42fe1c2852561ea40a1380fc426d9c81">   20</a></span>&#160;<span class="preprocessor">#define TEA_BLOCK_LEN           8   </span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="tea_8h.html#a3fd2b1bcd7ddcf506237987ad780f495">   22</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DELTA   0x9E3779B9  </span></div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="tea_8h.html#a69479655ab94c875413d38689002ff98">   23</a></span>&#160;<span class="preprocessor">#define ROUNDS  32          </span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define swap_us(us) (((us&amp;0x00FF)&lt;&lt;8)|((us&amp;0xFF00)&gt;&gt;8))</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define swap_ul(ul) (((ul&amp;0x000000FF)&lt;&lt;24)|((ul&amp;0x0000FF00)&lt;&lt;8)|((ul&amp;0x00FF0000)&gt;&gt;8)|((ul&amp;0xFF000000)&gt;&gt;24))</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keywordtype">void</span> <a class="code" href="tea_8h.html#a982d969b3496c4117d0079f91048a5ba">hton_us</a>( uint16_t *us, uint8_t num );</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="keywordtype">void</span> <a class="code" href="tea_8h.html#aa8f61bcad3e32a5a398164a3de6ba287">hton_ul</a>( uint32_t *ul, uint8_t num );</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#ifndef ENDIAN_LITTLE</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hton_us(us)</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define hton_ul(ul)</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="tea_8h.html#ac6afabdc09a49a433ee19d8a9486056d">   49</a></span>&#160;<span class="preprocessor">#define min(a,b) ((a)&lt;(b)?(a):(b))</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="tea_8h.html#affe776513b24d84b39af8ab0930fef7f">   52</a></span>&#160;<span class="preprocessor">#define max(a,b) ((a)&gt;(b)?(a):(b))</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="keywordtype">void</span> <a class="code" href="tea_8h.html#a542935b6cd737dab8bf9c5bbfc10dbf0">tea_enc</a>( uint32_t *v, uint32_t *k );</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="keywordtype">void</span> <a class="code" href="tea_8h.html#aca30c56208449c7ff223be556d98df80">tea_dec</a>( uint32_t *v, uint32_t *k );</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor">#endif </span></div>
<div class="ttc" id="tea_8h_html_aca30c56208449c7ff223be556d98df80"><div class="ttname"><a href="tea_8h.html#aca30c56208449c7ff223be556d98df80">tea_dec</a></div><div class="ttdeci">void tea_dec(uint32_t *v, uint32_t *k)</div><div class="ttdoc">TEA decryption function. </div><div class="ttdef"><b>Definition:</b> tea.c:81</div></div>
<div class="ttc" id="tea_8h_html_a982d969b3496c4117d0079f91048a5ba"><div class="ttname"><a href="tea_8h.html#a982d969b3496c4117d0079f91048a5ba">hton_us</a></div><div class="ttdeci">void hton_us(uint16_t *us, uint8_t num)</div><div class="ttdoc">Byte swap multiple shorts. </div></div>
<div class="ttc" id="tea_8h_html_a542935b6cd737dab8bf9c5bbfc10dbf0"><div class="ttname"><a href="tea_8h.html#a542935b6cd737dab8bf9c5bbfc10dbf0">tea_enc</a></div><div class="ttdeci">void tea_enc(uint32_t *v, uint32_t *k)</div><div class="ttdoc">TEA encryption function. </div><div class="ttdef"><b>Definition:</b> tea.c:53</div></div>
<div class="ttc" id="tea_8h_html_aa8f61bcad3e32a5a398164a3de6ba287"><div class="ttname"><a href="tea_8h.html#aa8f61bcad3e32a5a398164a3de6ba287">hton_ul</a></div><div class="ttdeci">void hton_ul(uint32_t *ul, uint8_t num)</div><div class="ttdoc">Byte swap multiple longs. </div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jun 4 2014 18:13:31 for PintarOS by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
